package nbcp.db.mq

import org.aspectj.lang.ProceedingJoinPoint
import org.aspectj.lang.annotation.Around
import org.aspectj.lang.annotation.Aspect
import org.aspectj.lang.annotation.Pointcut
import org.springframework.context.annotation.Lazy
import org.springframework.stereotype.Component


@Aspect
@Component
class MqAopIntercepetor {
    @Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitListener)")
    fun rabbitLisenerIntercepetor(joinPoint: ProceedingJoinPoint) :Any?{

        var args = joinPoint.args
        if (args.any()) {
            return joinPoint.proceed(args)
        } else {
            return joinPoint.proceed()
        }
    }
}